/*
 * @Author: huangtianyang 916072572@qq.com
 * @Date: 2022-12-07 10:41:38
 * @LastEditors: huangtianyang
 * @LastEditTime: 2022-12-29 15:00:18
 * @FilePath: \cxl-admin\src\apis\login\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import axios from '../../axios/index'

/**
 * 登录接口
 * @param phone
 * @param password
 * @returns
 */
export const login = (phone: string, password: string) => {
    return axios({
        method: 'post',
        url: '/api/system/admin/login',
        data: { password, phone }
    })
}

/**
 * 退出登录
 * @returns
 */
export const logOut = () => {
    return axios({
        method: 'get',
        url: '/api/system/admin/logout'
    })
}

/**
 * 查询用户信息
 * @returns
 */
export const currentUserInformation = () => {
    return axios({
        method: 'get',
        url: '/api/system/admin/findCurrentAdmin'
    })
}

/**
 * 刷新token
 */
export const refreshToken = () => {
    return axios({
        method: 'post',
        url: '/api/system/admin/refreshToken'
    })
}
